Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create functions for plotting #227

Closed
wants to merge 1 commit into from

Conversation

gnawin
Copy link
Member

@gnawin gnawin commented Nov 2, 2023

Pull request details

Describe the changes made in this pull request

This is a draft PR.

Aims to create (interactive) functions for the following plots:

  1. time series for a single flow
  2. graph with flow values
  3. balance (stacked bar charts) for assets

In this PR, the first plot has been included, and the second is a WIP.

In addition, I realized there is no existing function for running the model and deriving the results (apart from the test). For this purpose, also a file in src has been added. This may related to #209. Is creating such a file a desired way to do so?

On some technical notes,

  • in show_flow_time_series, plot() did not work, but TulipaEnergyModel.plot() did. Therefore I added export plot in TulipaEnergyModel.jl. But it feels weird.
  • I'm still testing plotting the graph with edge labels, so far it is not working yet. I'll continue next week.

@datejada does this resemble more or less what you have in mind? I feel the changes so far deviate from the initial discussion, so it's better to discuss them before I'm caught away.

@abelsiqueira any ideas on the comment regarding using analysis_results.jl and the technical notes?

List of related issues or pull requests

Concerns #191 and possibly to some extent overlaps with #209

Collaboration confirmation

As a contributor I confirm

  • I read and followed the instructions in README.dev.md
  • The documentation is up to date with the changes introduced in this Pull Request (or NA)
  • Tests are passing
  • Lint is passing

@gnawin gnawin added the question Marker that this issue should be discussed at the next meeting label Nov 3, 2023
@gnawin
Copy link
Member Author

gnawin commented Nov 6, 2023

Hi @abelsiqueira @datejada @clizbe,
I will be in Delft this Wednesday, so I probably can't follow up on this PR soon (earliest this Friday). So if anyone is interested, feel free to pick this up.

Copy link
Member

@abelsiqueira abelsiqueira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some comments. We discuss more after #209.

@@ -6,6 +6,9 @@ using DataFrames
using Graphs
using HiGHS
using JuMP
using Plots

export plot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be necessary.


edge_label_list = [edge_labels[(src(e), dst(e))] for e in edges(graph)]
g = gplot(graph; edgelabel = edge_label_list)
display(g)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I ignore this file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @abelsiqueira ,
The rationale for having this file is given above

In addition, I realized there is no existing function for running the model and deriving the results (apart from the test). For this purpose, also a file in src has been added. This may related to #209. Is creating such a file a desired way to do so?

The line 16-18 is just some early codes for plotting the graph with edge values, which are not working yet.

I'm not sure which you'd like to dump, but feel free to do so as I won't be able to follow it up soon. Thanks.

Comment on lines +215 to +226
show_flow_time_series()

Plots a time series for a flow, given asset `from_flow`, asset `to_flow`,
`representative_period`, `set_time_steps`, and solution flow.
"""
function show_flow_time_series(
from_flow,
to_flow,
representative_period,
set_time_steps,
v_flow,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these names have to be checked against #208

@gnawin gnawin closed this Nov 29, 2023
@gnawin gnawin deleted the 191-plot-function branch February 21, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Marker that this issue should be discussed at the next meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants